package com.zmn.plat.manager.dictionary;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.zmn.common.constant.GlobalConsts;
import com.zmn.common.dictionary.DictModel;
import com.zmn.common.dto.VtDTO;
import com.zmn.common.utils.string.StringUtil;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 描述：产品字典
 *
 * @author wangjie
 * @since 2018/10/18 14:51
 */
public class ProductDict {

    public final static int ZERO = 0;
    public final static int HUNDRED = 100;
    public final static String COPY_ZN = "(复制)";
    public final static double DOUBLE_ZERO = 0.0;

    /**
     * 服务分类：清洗 1001
     */
    public final static int SERVCATEGID_QX = 1001;

    /**
     * plat 产品模块文件上传地址
     */
    public final static String SERV_PRODUCT_UPLOAD_IMAGES_PATH = "plat/product/";

    /**
     * 价格类型：1基础，2城市价
     */
    public final static int PRICE_TYPE_BASE = 1;
    public final static int PRICE_TYPE_CITY = 2;
    public final static int PRICE_TYPE_PRICE_TABLE = 3;

    /**
     * 类型 1,故障分组；2,保修分组
     */
    public final static Integer SUBSIDIARY_TYPE_FAULT = 1;
    public final static Integer SUBSIDIARY_TYPE_WARRANTY = 1;

    /**
     * 产品修改状态标记
     */
    public final static int FLAG_SUCCESS = 1;
    public final static int FLAG_ATTR_ERROR = 2;
    public final static int FLAG_NAME_ERROR = 3;
    public final static int FLAG_TAFIFF_NAME_ERROR = 4;

    /**
     * 渠道产品名称与通用产品名称重复
     */
    public final static int FLAG_CHANNEL_PRODUCT_NAME_SAME_AS_PRODUCT_NAME_ERROR = 5;
    /**
     * 同一个渠道下的渠道产品名称重复
     */
    public final static int FLAG_CHANNEL_PRODUCT_NAME_ERROR = 6;

    /**
     * 当前品类下，默认产品已经存在（一个前台服务分类+前台二级产品分类，只能设置一个默认产品）
     */
    public final static int FLAG_DEFAULT_PRODUCT_EXIST_ERROR = 7;


    /**
     * 状态：1-禁用，2-启用
     */
    public final static int STATUS_DISABLE = 1;
    public final static int STATUS_ENABLE = 2;

    /**
     * 业务使用范围：1.基础产品 2.渠道产品
     */
    public final static int PRICE_SERVICE_TYPE_BASE = 1;
    public final static int PRICE_SERVICE_TYPE_CHANNEL = 2;

    /**
     * 平台类型：1-言而有信，2-啄木鸟
     */
    public final static int PLAT_YEYX = 20;
    public final static int PLAT_ZMN = 10;
    /**
     * 保内/保外：1.保外  2.保内  3.全部（保外/保内）
     */
    public static final int WARRANTY_TYPE_OUT = 1;
    public static final int WARRANTY_TYPE_IN = 2;
    public static final int WARRANTY_TYPE_ALL = 3;

    /**
     * 1.啄木鸟、2.言而有信、4.川南环保、3.一步生活，如果展示平台有多个，用',''隔开
     */
    public static final int SHOW_PLAT_ZMN = 10;
    public static final int SHOW_PLAT_YEYX = 20;
    public static final int SHOW_PLAT_SAAS = 30;
    public static final int SHOW_PLAT_CNHB = 40;

    public final static int PLAT_MAST_MASTER_MANAGER_NOT = 2;

    /**
     * 目前城市价的设置根据服务组名称模糊匹配是否包含服务收费
     */
    public static final String GROUP_NAME_FWSF = "服务收费";

    /**
     * 默认服务项：1-否，2-是
     */
    public final static int DEFAULT_ITEM_NO = 1;
    public final static int DEFAULT_ITEM_YES = 2;


    /**
     * 描述:1全局互斥，2局部互斥，3不互斥
     * 注：全局互斥（上门费、免费服务、特殊调整项）
     *
     * @author wangjie
     * @since 9:47 2019/5/22
     **/
    public final static int GLOBAL_MUTEXES = 1;
    public final static int LOCAL_EXCLUSIVE = 2;
    public final static int NOT_MUTEXES = 3;


    /**
     * 描述:只读标记：1否，2是
     *
     * @author wangjie
     * @since 9:52 2019/5/22
     **/
    public final static int READ_ONLY_TRUE = 2;
    public final static int READ_ONLY_FALSE = 1;


    /**
     * 描述:是否可见：1否2是
     *
     * @author wangjie
     * @since 9:54 2019/5/22
     **/
    public final static int IS_SHOW_TRUE = 2;
    public final static int IS_SHOW_FALSE = 1;

    /**
     * 描述:是否允许人工输入价格：1否2是
     *
     * @author wangjie
     * @since 10:09 2019/5/22
     **/
    public static final int MANUAL_PRICE_FALSE = 1;
    public static final int MANUAL_PRICE_TRUE = 2;


    /**
     * 描述:是否受系数影响1否2是
     *
     * @author wangjie
     * @since 10:24 2019/5/22
     **/
    public static final int RADIO_TRUE = 2;
    public static final int RADIO_FALSE = 1;

    /**
     * 描述: 服务项一口价 1 否 2 是
     *
     * @author wangjie
     * @since 16:50 2019/7/3
     **/
    public final static int FIXED_PRICE_TRUE = 2;
    public final static int FIXED_PRICE_FALSE = 1;

    /**
     * 描述:是否通用1否2是
     *
     * @author wangjie
     * @since 11:36 2019/5/24
     **/
    public static final int CURRENCY_TRUE = 2;
    public static final int CURRENCY_FALSE = 1;

    /**
     * 描述: 产品前后台数据 1 后台 2 前台
     *
     * @author wangjie
     * @since 2019/9/25
     **/
    public static final int ERP_PRODUCT_TYPE = 1;
    public static final int EC_PRODUCT_TYPE = 2;

    /**
     * 描述: 价格表类型
     * 1 服务 2 计价器 3 提前付 4 计价器3.0
     *
     * @author wangjie
     * @since 2019/9/25
     **/
    public static final int TRIFF_TYPE_SERVICE = 1;
    public static final int TRIFF_TYPE_TARIFF = 2;
    public static final int TRIFF_TYPE_ADVANCE = 3;
    public static final int TRIFF_TYPE_TARIFF3 = 4;

    /**
     * 描述: 定价方式：1系数定价 2城市定价
     *
     * @author wangjie
     * @since 2019/9/25
     **/
    public static final int TRIFF_PRICE_TYPE_RATIO = 1;
    public static final int TRIFF_PRICE_TYPE_CITY = 2;

    /**
     * 描述: 服务项价格管理导出
     *
     * @author wangjie
     * @since 16:45 2019/5/20
     **/
    public static final String SERV_TYPE = "服务分类";
    public static final String CATE_ONE_TYPE = "产品一级分类名称";
    public static final String CATE_TYPE = "产品二级分类名称";
    public static final String PRODUCT_NAME = "产品名称";
    public static final String PRODUCT_STATUS = "产品状态";
    public static final String SER_GROUP_NAME = "服务组名称";
    public static final String SER_ITEM_NAME = "服务项名称";
    public static final String SER_ITEM_ID = "服务项ID";
    public static final String SER_ITEM_STATUS = "服务项状态";
    public static final String UNIT = "单位";
    public static final String BASIC_PRICE = "基础价格";
    public static final String PRODUCT_ID = "产品ID";
    public static final String SERVICE_ITEM_REMARK = "服务项说明";
    public static final String MUTEX = "排他性";
    public static final String MANUAL_PRICE = "修改价格";
    public static final String RATIO = "系数影响";
    public static final String MAX_COUNT = "最大数量";
    public static final String FAULT_GROUP = "故障分组";
    public static final String WARRANTY_GROUP = "保修分组";
    public static final String FICO_CTEG = "绩效分类";
    public static final String OUTSIDE_USE = "外部可见";
    public static final String FIXED_PRICE = "一口价";
    public static final String READ_ONLY = "是否只读";
    public static final String SHOW = "是否显示";
    public static final String DEFAULT_ITEM = "是否默认";

    /**
     * 描述: 操作类型, 1 新增, 2 修改
     *
     * @author wangjie
     * @since 16:45 2019/5/29
     **/
    public static final Integer OPERATION_ADD = 1;
    public static final Integer OPERATION_MODIFY = 2;
    public static final Integer OPERATION_DETAIL = 3;

    /**
     * 描述: 导出表格价格填充
     *
     * @author wangjie
     * @since 10:44 2019/5/21
     **/
    public static final String NEGOTIABLE = "面议";

    /**
     * 描述: 导出表格基础数据
     *
     * @author wangjie
     * @since 10:45 2019/5/21
     **/
    public static final Double BASIC_DATA = 0.00;

    /**
     * 默认产品分类价格表
     */
    public static final Integer DEFAULT_PRICE = 2;

    /**
     * 保内通用价格表
     */
    public static final String DEFAULT_PRICE_NAME_WARRANTY_IN = "-保内通用价格表";

    /**
     * 保外通用价格表
     */
    public static final String DEFAULT_PRICE_NAME_WARRANTY_OUT = "-保外通用价格表";

    /**
     * 功能描述： 订单取消类型 运营平台
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int ORDER_CANCEL_TYPE_BACK = 1;
    /**
     * 功能描述： 订单取消类型 厂商门户
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int ORDER_CANCEL_TYPE_FRONT = 2;
    /**
     * 功能描述： 订单取消类型 服务商门户
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int ORDER_CANCEL_TYPE_FACTORY = 3;
    /**
     * 功能描述： 订单取消类型 用户
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int ORDER_CANCEL_TYPE_SERVICE = 4;

    /**
     * 功能描述： 订单取消类型 系统
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int ORDER_CANCEL_TYPE_SYSTEM = 5;

    /**
     * 功能描述： 订单取消节点 未派单取消
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int ORDER_CANCEL_NODE_NOT_SEND = 1;
    /**
     * 功能描述： 订单取消节点 未上门取消
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int ORDER_CANCEL_NODE_NOT_SERVICE = 2;
    /**
     * 功能描述： 订单取消类型 前台
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int ORDER_CANCEL_NODE_SERVICE = 3;

    /**
     * 功能描述： 订单评论类型 后台
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int ORDER_COMMENT_TYPE_BACK = 1;
    /**
     * 功能描述： 订单评论类型 用户
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int ORDER_COMMENT_TYPE_USER = 2;

    /**
     * 功能描述：订单配置 评星 1星
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int ONE_STAR = 1;
    /**
     * 功能描述：订单配置 评星 2星
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int TWO_STAR = 2;
    /**
     * 功能描述：订单配置 评星 3星
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int THREE_STAR = 3;
    /**
     * 功能描述：订单配置 评星 4星
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int FOUR_STAR = 4;
    /**
     * 功能描述：订单配置 评星 5星
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int FIVE_STAR = 5;

    /**
     * 功能描述：投诉分类级别 1级
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int COMPLAINT_TYPE_ONE = 1;
    /**
     * 功能描述：投诉分类级别 2级
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int COMPLAINT_TYPE_TWO = 2;

    /**
     * 功能描述：投诉分类级别 一级分类父节点1
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int COMPLAINT_CATEGORY_DEFAULT_PARENTID = 1;


    /**
     * 功能描述：投诉等级 1解释
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int COMPLAINT_LEVEL_ONE = 1;
    /**
     * 功能描述：投诉等级 2提醒
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int COMPLAINT_LEVEL_TWO = 2;
    /**
     * 功能描述：投诉等级 3一级
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int COMPLAINT_LEVEL_THREE = 3;
    /**
     * 功能描述：投诉等级 4二级
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int COMPLAINT_LEVEL_FOUR = 4;
    /**
     * 功能描述：投诉等级  5三级
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int COMPLAINT_LEVEL_FIVE = 5;
    /**
     * 功能描述：投诉等级  5四级
     *
     * @author tanbiao
     * @since 2019/10/23
     */
    public static final int COMPLAINT_LEVEL_SIX = 6;

    /**
     * 产品类型：1.通用产品
     */
    public static final int CURRENCY_PRODUCT = 1;

    /**
     * 产品类型：2.渠道产品
     */
    public static final int CHANNEL_PRODUCT = 2;


    /**
     * 描述:状态：1-禁用，2-启用 list
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author wangjie
     * @since 9:59 2019/5/22
     **/
    public static List<DictModel> getStatuslist() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(ProductDict.STATUS_ENABLE);
        arrayList.add(new DictModel(ProductDict.STATUS_DISABLE, "下架"));
        arrayList.add(new DictModel(ProductDict.STATUS_ENABLE, "上架"));
        return arrayList;
    }

    public static String getShowPlatName(int channelType) {
        switch (channelType) {
            case SHOW_PLAT_ZMN:
                return "啄木鸟";
            case SHOW_PLAT_YEYX:
                return "言而有信";
            case SHOW_PLAT_CNHB:
                return "川南环保";
            case SHOW_PLAT_SAAS:
                return "一步维修";
            default:
                return "";
        }
    }

    /**
     * 功能描述 :针对多平台的显示
     *
     * @param platStr
     * @return java.lang.String
     * @author tanbiao
     * @modifier
     * @since 2019/10/23
     */
    public static String getPlatNameByPlates(String platStr) {
        if (StringUtil.isNotBlank(platStr)) {
            List<Integer> plats = Arrays.stream(platStr.split(",")).map(e -> Integer.parseInt(e)).collect(Collectors.toList());
            StringBuilder stringBulider = new StringBuilder();
            plats.forEach(e -> stringBulider.append(GlobalConsts.getPlatName(e)).append(","));
            return stringBulider.deleteCharAt(stringBulider.length() - 1).toString();
        }
        return "";
    }

    /**
     * 功能描述 :针对$1$2$这种分割的字符串 按照传入的kvMap拼接他们的中文释意
     *
     * @param idStr
     * @param kvMap
     * @return java.lang.String
     * @author linfeng
     * @since 2020/04/16
     */
    public static String getUnionNameBykvMapIdStr(String idStr, Map<Integer, String> kvMap) {
        if (StringUtil.isNotBlank(idStr)) {
            idStr = trimBothEndsChars(idStr, "\\$");
            List<Integer> plats = Arrays.stream(idStr.split("\\$")).map(e -> Integer.parseInt(e)).collect(Collectors.toList());
            StringBuilder stringBulider = new StringBuilder();
            plats.forEach(e -> stringBulider.append(kvMap.get(e)).append("、"));
            return stringBulider.deleteCharAt(stringBulider.length() - 1).toString();
        }
        return "";
    }

    public static String trimBothEndsChars(String srcStr, String splitter) {
        String regex = "^" + splitter + "*|" + splitter + "*$";
        return srcStr.replaceAll(regex, "");
    }

    public static String getProductStatus(int outsideUse) {
        switch (outsideUse) {
            case STATUS_DISABLE:
                return "下架";
            case STATUS_ENABLE:
                return "上架";
            default:
                return "全部";
        }
    }

    public static String getWarranty(int outsideUse) {
        switch (outsideUse) {
            case WARRANTY_TYPE_OUT:
                return "保外";
            case WARRANTY_TYPE_IN:
                return "保内";
            default:
                return "全部";
        }
    }

    public static String getOutsideUse(int outsideUse) {
        switch (outsideUse) {
            case DEFAULT_ITEM_NO:
                return "否";
            case DEFAULT_ITEM_YES:
                return "是";
            default:
                return "";
        }
    }

    public static String getMutex(int mutex) {
        switch (mutex) {
            case GLOBAL_MUTEXES:
                return "全局互斥";
            case LOCAL_EXCLUSIVE:
                return "局部互斥";
            case NOT_MUTEXES:
                return "不互斥";
            default:
                return "";
        }
    }

    /**
     * 描述: 地图上服务范围类型 ：1多边形，2圆形
     */
    public static List<DictModel> getServiceScopeTypeList() {
        List<DictModel> items = new ArrayList<>();
        items.add(new DictModel(1, "多边形"));
        items.add(new DictModel(2, "圆形"));
        return items;
    }

    /**
     * 描述: 默认服务项：1-否，2-是 list
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author wangjie
     * @since 9:56 2019/5/22
     **/
    public static List<DictModel> getDefaultItemList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(ProductDict.DEFAULT_ITEM_YES);
        arrayList.add(new DictModel(ProductDict.DEFAULT_ITEM_NO, "否"));
        arrayList.add(new DictModel(ProductDict.DEFAULT_ITEM_YES, "是"));
        return arrayList;
    }

    /**
     * 描述: 排他性集合
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author wangjie
     * @since 9:49 2019/5/22
     **/
    public static List<DictModel> getMutexesList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(ProductDict.NOT_MUTEXES);
        arrayList.add(new DictModel(ProductDict.GLOBAL_MUTEXES, "全局互斥"));
        arrayList.add(new DictModel(ProductDict.LOCAL_EXCLUSIVE, "局部互斥"));
        arrayList.add(new DictModel(ProductDict.NOT_MUTEXES, "不互斥"));
        return arrayList;
    }

    /**
     * 描述: 只读标记：1否，2list
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author wangjie
     * @since 9:53 2019/5/22
     **/
    public static List<DictModel> getReadOnlyList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(ProductDict.READ_ONLY_TRUE);
        arrayList.add(new DictModel(ProductDict.READ_ONLY_TRUE, "是"));
        arrayList.add(new DictModel(ProductDict.READ_ONLY_FALSE, "否"));
        return arrayList;
    }

    /**
     * 描述: 是否可见：1否，2list
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author wangjie
     * @since 9:53 2019/5/22
     **/
    public static List<DictModel> getIsShowList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(ProductDict.IS_SHOW_FALSE);
        arrayList.add(new DictModel(ProductDict.IS_SHOW_TRUE, "是"));
        arrayList.add(new DictModel(ProductDict.IS_SHOW_FALSE, "否"));
        return arrayList;
    }

    /**
     * 描述: 是否允许人工输入价格：1否2是 list
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author wangjie
     * @since 9:53 2019/5/22
     **/
    public static List<DictModel> getManualPriceList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(ProductDict.MANUAL_PRICE_TRUE);
        arrayList.add(new DictModel(ProductDict.MANUAL_PRICE_TRUE, "是"));
        arrayList.add(new DictModel(ProductDict.MANUAL_PRICE_FALSE, "否"));
        return arrayList;
    }


    /**
     * 描述: 是否受系数影响1否2是 list
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author wangjie
     * @since 9:53 2019/5/22
     **/
    public static List<DictModel> getRadioList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(ProductDict.RADIO_TRUE);
        arrayList.add(new DictModel(ProductDict.RADIO_TRUE, "是"));
        arrayList.add(new DictModel(ProductDict.RADIO_FALSE, "否"));
        return arrayList;
    }


    /**
     * 描述: 服务项一口价选项字典
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author wangjie
     * @since 16:53 2019/7/3
     **/
    public static List<DictModel> getFixedPrice() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(ProductDict.RADIO_TRUE);
        arrayList.add(new DictModel(ProductDict.FIXED_PRICE_TRUE, "是"));
        arrayList.add(new DictModel(ProductDict.FIXED_PRICE_FALSE, "否"));
        return arrayList;
    }

    /**
     * 描述: 根据 List<DictModel> 转换为Map类型的数据
     *
     * @param dictModels DictModel模型
     * @return java.util.Map<java.lang.Integer, java.lang.String>
     * @author wangjie
     * @since 10:04 2019/5/22
     **/
    public static Map<Integer, String> getDictModelMap(List<DictModel> dictModels) {
        if (CollectionUtils.isEmpty(dictModels)) {
            return Maps.newHashMapWithExpectedSize(GlobalConsts.NONE);
        }
        return dictModels.stream().collect(Collectors.toMap(DictModel::getKey, DictModel::getValue));
    }


    public static List<DictModel> getCurrencyList() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(ProductDict.CURRENCY_TRUE);
        arrayList.add(new DictModel(ProductDict.CURRENCY_TRUE, "是"));
        arrayList.add(new DictModel(ProductDict.CURRENCY_FALSE, "否"));
        return arrayList;
    }

    /**
     * 保内保外类型列表：1.保外  2.保内
     *
     * @return
     */
    public static List<DictModel> getWarrantyTypeList() {
        List<DictModel> items = new ArrayList();
        items.add(new DictModel(WARRANTY_TYPE_OUT, "保外"));
        items.add(new DictModel(WARRANTY_TYPE_IN, "保内"));
        return items;
    }

    /**
     * 保内保外类型列表：1.保外  2.保内  3.全部（保外/保内）
     *
     * @return
     */
    public static List<DictModel> getWarrantyTypeAllList() {
        List<DictModel> items = new ArrayList();
        items.add(new DictModel(WARRANTY_TYPE_OUT, "保外"));
        items.add(new DictModel(WARRANTY_TYPE_IN, "保内"));
        items.add(new DictModel(WARRANTY_TYPE_ALL, "全部"));
        return items;
    }

    /**
     * 功能描述 :取消类型 1后台 2前台
     *
     * @param
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanbiao
     * @modifier
     * @since 2019/10/22
     */
    public static List<DictModel> getCancelTypeList() {
        List<DictModel> items = Lists.newArrayList();
        items.add(new DictModel(2, "用户"));
        items.add(new DictModel(1, "运营平台"));
        items.add(new DictModel(3, "厂商门户"));
        items.add(new DictModel(4, "服务商门户"));
        items.add(new DictModel(ORDER_CANCEL_TYPE_SYSTEM, "系统"));
        return items;
    }

    public static List<DictModel> getQuestionTypeList() {
        List<DictModel> items = Lists.newArrayList();
        items.add(new DictModel(1, "单选"));
        items.add(new DictModel(2, "多选"));
        items.add(new DictModel(3, "手动输入"));
        return items;
    }

    /**
     * 获取平台list
     *
     * @return
     */
    public static List<DictModel> getPlatList() {
        List<DictModel> items = Lists.newArrayList();
        items.add(new DictModel(GlobalConsts.PLAT_MARK_ZMN, "啄木鸟"));
        items.add(new DictModel(GlobalConsts.PLAT_MARK_YEYX, "言而有信"));
        items.add(new DictModel(GlobalConsts.PLAT_MARK_SAAS, "一步维修"));
        items.add(new DictModel(GlobalConsts.PLAT_MARK_CNHB, "川南环保"));

        return items;
    }

    /**
     * 功能描述 :多个类型拼装成字符串
     *
     * @param
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanbiao
     * @modifier
     * @since 2019/10/22
     */
    public static String getCancelTypeStr(String cancelTypes) {
        if (StringUtil.isNotBlank(cancelTypes)) {
            List<Integer> plats = Arrays.stream(cancelTypes.split(",")).map(e -> Integer.parseInt(e)).collect(Collectors.toList());
            StringBuilder stringBulider = new StringBuilder();
            plats.forEach(e -> {
                if (e.equals(ORDER_CANCEL_TYPE_BACK)) {
                    stringBulider.append("运营平台").append(",");
                } else if (e.equals(ORDER_CANCEL_TYPE_FRONT)) {
                    stringBulider.append("用户").append(",");
                } else if (e.equals(ORDER_CANCEL_TYPE_FACTORY)) {
                    stringBulider.append("厂商门户").append(",");
                } else if (e.equals(ORDER_CANCEL_TYPE_SERVICE)) {
                    stringBulider.append("服务商门户").append(",");
                } else if (e.equals(ORDER_CANCEL_TYPE_SYSTEM)) {
                    stringBulider.append("系统").append(",");
                }
            });
            return stringBulider.deleteCharAt(stringBulider.length() - 1).toString();
        }
        return "";
    }

    /**
     * 功能描述 :评价类型 1后台 2用户
     *
     * @param
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanbiao
     * @modifier
     * @since 2019/10/22
     */
    public static List<DictModel> getOrderCommentTypeList() {
        List<DictModel> items = Lists.newArrayList();
        items.add(new DictModel(2, "用户"));
        items.add(new DictModel(1, "后台"));
        return items;
    }

    /**
     * 功能描述 :多个类型拼装成字符串
     *
     * @param
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanbiao
     * @modifier
     * @since 2019/10/22
     */
    public static String getOrderCommentTypeStr(String commentTypes) {
        if (StringUtil.isNotBlank(commentTypes)) {
            List<Integer> plats = Arrays.stream(commentTypes.split(",")).map(e -> Integer.parseInt(e)).collect(Collectors.toList());
            StringBuilder stringBulider = new StringBuilder();
            plats.forEach(e -> {
                if (e.equals(ORDER_COMMENT_TYPE_BACK)) {
                    stringBulider.append("后台").append(",");
                } else if (e.equals(ORDER_COMMENT_TYPE_USER)) {
                    stringBulider.append("用户").append(",");
                }
            });
            return stringBulider.deleteCharAt(stringBulider.length() - 1).toString();
        }
        return "";
    }

    /**
     * 功能描述 :评价评星
     *
     * @param
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanbiao
     * @modifier
     * @since 2019/10/22
     */
    public static List<DictModel> getOrderCommentStarsList() {
        List<DictModel> items = Lists.newArrayList();
        items.add(new DictModel(1, "1星"));
        items.add(new DictModel(2, "2星"));
        items.add(new DictModel(3, "3星"));
        items.add(new DictModel(4, "4星"));
        items.add(new DictModel(5, "5星"));
        return items;
    }

    /**
     * 功能描述 :多个类型拼装成字符串
     *
     * @param
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanbiao
     * @modifier
     * @since 2019/10/22
     */
    public static String getOrderCommentStarsStr(String stars) {
        if (StringUtil.isNotBlank(stars)) {
            List<Integer> plats = Arrays.stream(stars.split(",")).map(e -> Integer.parseInt(e)).collect(Collectors.toList());
            StringBuilder stringBulider = new StringBuilder();
            plats.forEach(e -> {
                if (e.equals(ONE_STAR)) {
                    stringBulider.append("1星").append(",");
                } else if (e.equals(TWO_STAR)) {
                    stringBulider.append("2星").append(",");
                } else if (e.equals(THREE_STAR)) {
                    stringBulider.append("3星").append(",");
                } else if (e.equals(FOUR_STAR)) {
                    stringBulider.append("4星").append(",");
                } else if (e.equals(FIVE_STAR)) {
                    stringBulider.append("5星").append(",");
                }
            });
            return stringBulider.deleteCharAt(stringBulider.length() - 1).toString();
        }
        return "";
    }

    /**
     * 功能描述 :投诉等级 1解释 2提醒 3一级 4二级 5三级
     *
     * @param
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanbiao
     * @modifier
     * @since 2019/10/22
     */
    public static List<DictModel> getOrderComplaintLevelList() {
        List<DictModel> items = Lists.newArrayList();
        items.add(new DictModel(1, "解释"));
        items.add(new DictModel(2, "提醒"));
        items.add(new DictModel(3, "一级"));
        items.add(new DictModel(4, "二级"));
        items.add(new DictModel(5, "三级"));
        items.add(new DictModel(6, "四级"));
        return items;
    }

    /**
     * 功能描述 :异常等级 1一级 2二级 3三级
     *
     * @param
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author linfeng
     * @modifier
     * @since 2019/10/29
     */
    public static List<DictModel> getOrderExceptionLevelList() {
        List<DictModel> items = Lists.newArrayList();
        items.add(new DictModel(1, "一级"));
        items.add(new DictModel(2, "二级"));
        items.add(new DictModel(3, "三级"));
        return items;
    }

    public static String getOrderComplaintLevelStr(Integer level) {
        if (null == level) {
            return "";
        }
        if (level.equals(COMPLAINT_LEVEL_ONE)) {
            return "解释";
        } else if (level.equals(COMPLAINT_LEVEL_TWO)) {
            return "提醒";
        } else if (level.equals(COMPLAINT_LEVEL_THREE)) {
            return "一级";
        } else if (level.equals(COMPLAINT_LEVEL_FOUR)) {
            return "二级";
        } else if (level.equals(COMPLAINT_LEVEL_FIVE)) {
            return "三级";
        } else if (level.equals(COMPLAINT_LEVEL_SIX)) {
            return "四级";
        } else {
            return "未知";
        }
    }


    /**
     * 功能描述 :取消节点：1 未派单取消、2 未上门取消、3 已上门取消
     *
     * @param
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author tanbiao
     * @modifier
     * @since 2019/10/22
     */
    public static List<DictModel> getCancelNodeList() {
        List<DictModel> items = Lists.newArrayList();
        items.add(new DictModel(2, "未上门取消"));
        items.add(new DictModel(1, "未派单取消"));
        items.add(new DictModel(3, "已上门取消"));
        return items;
    }

    public static String getCancelNodeStr(String cancelNodes) {
        if (StringUtil.isNotBlank(cancelNodes)) {
            List<Integer> plats = Arrays.stream(cancelNodes.split(",")).map(e -> Integer.parseInt(e)).collect(Collectors.toList());
            StringBuilder stringBulider = new StringBuilder();
            plats.forEach(e -> {
                if (e.equals(ORDER_CANCEL_NODE_NOT_SEND)) {
                    stringBulider.append("未派单取消").append(",");
                } else if (e.equals(ORDER_CANCEL_NODE_NOT_SERVICE)) {
                    stringBulider.append("未上门取消").append(",");
                } else if (e.equals(ORDER_CANCEL_NODE_SERVICE)) {
                    stringBulider.append("已上门取消").append(",");
                }
            });
            return stringBulider.deleteCharAt(stringBulider.length() - 1).toString();
        }
        return "";
    }

    /**
     * 描述: 产品前后台数据
     *
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author wangjie
     * @since 2019/9/25
     **/
    public static List<VtDTO> getProductErpEsTypeList() {
        return Arrays.asList(new VtDTO(ERP_PRODUCT_TYPE, "后台产品"), new VtDTO(EC_PRODUCT_TYPE, "前台产品"));
    }

    public static String getProductType(int productType) {
        switch (productType) {
            case CURRENCY_PRODUCT:
                return "通用产品";
            case CHANNEL_PRODUCT:
                return "渠道产品";
            default:
                return "";
        }
    }
}
